Skip to main content

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 .sas scripts

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.py or 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

saspytest-0.1.2.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

saspytest-0.1.2-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

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

Hashes for saspytest-0.1.2.tar.gz
Algorithm Hash digest
SHA256 658e73380782663b1659acd9ee9c8d1842a2c9e872a7fd235a39776ccb6623fa
MD5 547879b73487de5c895bccf6f09c9768
BLAKE2b-256 9cca524990fffa21ddf8c9a79583bb40db01e078b566b0c99a6ee20748060d9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for saspytest-0.1.2.tar.gz:

Publisher: release.yml on awesome-sas/saspytest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for saspytest-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e1b470639e58c45d2c887b515ddda44756e3194b91d5ea684e5e89559805aac6
MD5 d04b941418b7ba73917ce0fa6aed480e
BLAKE2b-256 54df7beed957dea1f5c079e1fc65fc04245c17811df39314803b265546c3f5df

See more details on using hashes here.

Provenance

The following attestation bundles were made for saspytest-0.1.2-py3-none-any.whl:

Publisher: release.yml on awesome-sas/saspytest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page