Skip to main content

Crate use_pytest

Crate use_pytest 

Source
Expand description

§use-pytest

pytest testing metadata primitives for RustUse.

§Experimental

use-pytest is experimental while use-python remains below 0.3.0.

§Example

use use_pytest::{PytestMarkerName, PytestNodeId, PytestOutcome};

let marker = PytestMarkerName::new("slow")?;
let node_id = PytestNodeId::new("tests/test_app.py::test_smoke")?;

assert_eq!(marker.as_str(), "slow");
assert!(node_id.has_scope_separator());
assert_eq!(PytestOutcome::Passed.as_str(), "passed");

§Scope

  • Test, marker, fixture, and node ID metadata.
  • Config file, outcome, fixture scope, and file-kind labels.
  • Light ASCII identifier validation where appropriate.

§Non-goals

  • Executing pytest.
  • Parsing Python test files.
  • Collecting tests or interpreting pytest plugins.

§License

Licensed under either Apache-2.0 or MIT.

Structs§

PytestFixtureName
PytestMarkerName
PytestNodeId
pytest node ID metadata.
PytestTestName

Enums§

PytestConfigFile
Common pytest config file labels.
PytestFileKind
pytest file-kind labels.
PytestNameError
Error returned when pytest metadata names are invalid.
PytestOutcome
pytest outcome labels.
PytestScope
pytest fixture scope labels.