pytest support library for SAS testing with saspy
Project description
saspytest
pytest support library for SAS testing with saspy.
saspytest provides utility functions and pytest-style assertions for testing SAS programs through the saspy Python interface. It is inspired by SASUnit assertion macros.
Features
- Session management – Shared or isolated SAS sessions with automatic setup and teardown
- Log assertions – Validate SAS logs for errors, warnings, or custom patterns
- Dataset assertions – Check dataset existence, record counts, columns, and equality
- Macro assertions – Verify SAS macro variable values and existence
- File utilities – Upload/download files and submit local
.sasscripts
Installation
pip install saspytest
Prerequisites
- Python 3.9+
- A working saspy configuration that can connect to your SAS deployment
- Java (required by saspy for IOM connections)
Note: saspytest does not bundle proprietary SAS JARs. You must provide your own SAS deployment and configure saspy accordingly (e.g.
sascfg_personal.pyor environment variables).
Quickstart
from saspytest import (
assert_no_errors,
assert_dataset_exists,
assert_record_count,
)
def test_sas_program(sas_session):
result = sas_session.submit("""
data test;
do i = 1 to 5;
output;
end;
run;
""")
assert_no_errors(result["LOG"])
assert_dataset_exists(sas_session, "test")
assert_record_count(sas_session, "test", 5)
Documentation
- Full API reference: see
docs/API_REFERENCE.md - Development guidelines: see
docs/DEVELOPMENT_GUIDELINES.md
License
MIT License. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file saspytest-0.1.2.tar.gz.
File metadata
- Download URL: saspytest-0.1.2.tar.gz
- Upload date:
- Size: 19.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
658e73380782663b1659acd9ee9c8d1842a2c9e872a7fd235a39776ccb6623fa
|
|
| MD5 |
547879b73487de5c895bccf6f09c9768
|
|
| BLAKE2b-256 |
9cca524990fffa21ddf8c9a79583bb40db01e078b566b0c99a6ee20748060d9e
|
Provenance
The following attestation bundles were made for saspytest-0.1.2.tar.gz:
Publisher:
release.yml on awesome-sas/saspytest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
saspytest-0.1.2.tar.gz -
Subject digest:
658e73380782663b1659acd9ee9c8d1842a2c9e872a7fd235a39776ccb6623fa - Sigstore transparency entry: 1517512943
- Sigstore integration time:
-
Permalink:
awesome-sas/saspytest@e7e703761875b6d421fd1bba1f7912560783fcb6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/awesome-sas
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e7e703761875b6d421fd1bba1f7912560783fcb6 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file saspytest-0.1.2-py3-none-any.whl.
File metadata
- Download URL: saspytest-0.1.2-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1b470639e58c45d2c887b515ddda44756e3194b91d5ea684e5e89559805aac6
|
|
| MD5 |
d04b941418b7ba73917ce0fa6aed480e
|
|
| BLAKE2b-256 |
54df7beed957dea1f5c079e1fc65fc04245c17811df39314803b265546c3f5df
|
Provenance
The following attestation bundles were made for saspytest-0.1.2-py3-none-any.whl:
Publisher:
release.yml on awesome-sas/saspytest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
saspytest-0.1.2-py3-none-any.whl -
Subject digest:
e1b470639e58c45d2c887b515ddda44756e3194b91d5ea684e5e89559805aac6 - Sigstore transparency entry: 1517513019
- Sigstore integration time:
-
Permalink:
awesome-sas/saspytest@e7e703761875b6d421fd1bba1f7912560783fcb6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/awesome-sas
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e7e703761875b6d421fd1bba1f7912560783fcb6 -
Trigger Event:
workflow_dispatch
-
Statement type: