Coverage for /var/srv/projects/api.amasfac.comuna18.com/tmp/venv/lib/python3.9/site-packages/pandas/util/_tester.py: 32%

18 statements  

« prev     ^ index     » next       coverage.py v6.4.4, created at 2023-07-17 14:22 -0600

1""" 

2Entrypoint for testing from the top-level namespace. 

3""" 

4from __future__ import annotations 

5 

6import os 

7import sys 

8 

9from pandas.compat._optional import import_optional_dependency 

10 

11PKG = os.path.dirname(os.path.dirname(__file__)) 

12 

13 

14def test(extra_args: list[str] | None = None): 

15 """ 

16 Run the pandas test suite using pytest. 

17 

18 By default, runs with the marks --skip-slow, --skip-network, --skip-db 

19 

20 Parameters 

21 ---------- 

22 extra_args : list[str], default None 

23 Extra marks to run the tests. 

24 """ 

25 pytest = import_optional_dependency("pytest") 

26 import_optional_dependency("hypothesis") 

27 cmd = ["--skip-slow", "--skip-network", "--skip-db"] 

28 if extra_args: 

29 if not isinstance(extra_args, list): 

30 extra_args = [extra_args] 

31 cmd = extra_args 

32 cmd += [PKG] 

33 joined = " ".join(cmd) 

34 print(f"running: pytest {joined}") 

35 sys.exit(pytest.main(cmd)) 

36 

37 

38__all__ = ["test"]