Skip to main content

is_test_file

Function is_test_file 

Source
pub fn is_test_file(path: &str) -> bool
Expand description

Return true if path identifies a test file by Python convention:

  • base name matches test_*.py or *_test.py (pytest conventions), OR
  • base name is conftest.py (pytest configuration / shared fixtures), OR
  • any path segment is exactly tests (e.g. src/tests/foo.py).