@@ -180,17 +180,21 @@ def test_python_suite(session: Session) -> None:
180180 session .env ["IDOM_DEBUG_MODE" ] = "1"
181181 install_requirements_file (session , "test-env" )
182182 session .run ("playwright" , "install" , "chromium" )
183- posargs = session .posargs
184- posargs += ["--reruns" , "3" , "--reruns-delay" , "1" ]
183+ args = ["pytest" , "--reruns" , "3" , "--reruns-delay" , "1" , * session .posargs ]
185184
186- if "--no-cov" in session .posargs :
185+ check_cov = "--no-cov" not in session .posargs
186+ if check_cov :
187+ args = ["coverage" , "run" , "--source=src/idom" , "--module" , * args ]
188+ install_idom_dev (session )
189+ else :
190+ args .remove ("--no-cov" )
187191 session .log ("Coverage won't be checked" )
188192 session .install (".[all]" )
189- else :
190- posargs += ["--cov=src/idom" , "--cov-report" , "term" ]
191- install_idom_dev (session )
192193
193- session .run ("pytest" , * posargs )
194+ session .run (* args )
195+
196+ if check_cov :
197+ session .run ("coverage" , "report" )
194198
195199
196200@nox .session
@@ -209,14 +213,7 @@ def test_python_style(session: Session) -> None:
209213 """Check that Python style guidelines are being followed"""
210214 install_requirements_file (session , "check-style" )
211215 session .run ("flake8" , "src/idom" , "tests" , "docs" )
212- black_default_exclude = r"\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|\.svn|_build|buck-out|build|dist"
213- session .run (
214- "black" ,
215- "." ,
216- "--check" ,
217- "--exclude" ,
218- rf"/({ black_default_exclude } |venv|node_modules)/" ,
219- )
216+ session .run ("black" , "." , "--check" )
220217 session .run ("isort" , "." , "--check-only" )
221218
222219
0 commit comments