File tree Expand file tree Collapse file tree 3 files changed +46
-1
lines changed Expand file tree Collapse file tree 3 files changed +46
-1
lines changed Original file line number Diff line number Diff line change
1
+ # Root conftest.py
2
+ # This file ensures that pytest only collects tests from our tests directory
3
+ # and ignores any tests in temporary directories or installed packages
4
+
5
+ import os
6
+ import sys
7
+
8
+ # Add the 'src' directory to the path so imports work correctly
9
+ # This ensures that the in-development code is used, not the installed version
10
+ sys .path .insert (0 , os .path .abspath (os .path .join (os .path .dirname (__file__ ), "src" )))
11
+
12
+ def pytest_ignore_collect (collection_path , config ):
13
+ """
14
+ Configure pytest to ignore certain paths when collecting tests.
15
+
16
+ Returns:
17
+ bool: True if the path should be ignored, False otherwise.
18
+ """
19
+ # Skip the temp directory
20
+ if "temp/" in str (collection_path ):
21
+ return True
22
+
23
+ return False
Original file line number Diff line number Diff line change @@ -58,3 +58,25 @@ disable = [
58
58
" C0115" , # missing-class-docstring
59
59
" R0903" , # too-few-public-methods
60
60
]
61
+
62
+ [tool .pytest .ini_options ]
63
+ testpaths = [" tests" ]
64
+ python_files = " test_*.py"
65
+ python_classes = [" Test*" ]
66
+ python_functions = [" test_*" ]
67
+
68
+ [tool .coverage .run ]
69
+ source = [" src/api_to_dataframe" ]
70
+ omit = [
71
+ " tests/*" ,
72
+ " temp/*" ,
73
+ " */__init__.py" ,
74
+ ]
75
+
76
+ [tool .coverage .report ]
77
+ exclude_lines = [
78
+ " pragma: no cover" ,
79
+ " def __repr__" ,
80
+ " raise NotImplementedError" ,
81
+ " if __name__ == .__main__.:" ,
82
+ ]
Original file line number Diff line number Diff line change 7
7
8
8
9
9
def test_to_dataframe ():
10
- with pytest .raises (TypeError ):
10
+ with pytest .raises (ValueError ):
11
11
GetData .to_dataframe ("" )
12
12
13
13
You can’t perform that action at this time.
0 commit comments