Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/pandas/util/_tester.py: 39%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

18 statements  

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) -> 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"]