Skip to content

Commit

Permalink
Fix conftest imports (#126)
Browse files Browse the repository at this point in the history
* make: add check_conftest_imports target

* ci: Add check_conftest_imports and run code checks before tests

run tests first so CI exits faster
  • Loading branch information
g-k authored Jul 24, 2018
1 parent e5da7ea commit 9370805
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
language: python
python:
- "3.6"
sudo: required

before_install:
- curl -LO https://github.com/BurntSushi/ripgrep/releases/download/0.8.1/ripgrep_0.8.1_amd64.deb
- sudo dpkg -i ripgrep_0.8.1_amd64.deb

install:
- make install

script:
- make doctest coverage black
- make black check_conftest_imports doctest coverage
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ ifeq ($(VIRTUAL_ENV),)
$(error "Run pytest-services from a virtualenv (try 'make install && source venv/bin/activate')")
endif

check_conftest_imports:
# refs: https://github.com/mozilla-services/pytest-services/issues/119
rg '^import\s+conftest|^from\s+conftest\s+import\s+pytest' -g '*.py'; [ $$? -eq 1 ]

clean: clean-cache clean-python
rm -rf venv
# remember to deactivate your active virtual env
Expand Down Expand Up @@ -64,6 +68,7 @@ venv:
.PHONY:
all \
check_venv \
check_conftest_imports \
clean \
clean-cache \
clean-python \
Expand Down

0 comments on commit 9370805

Please sign in to comment.