Skip to content
Permalink
Browse files

Switch to suffix-based naming for test files

  • Loading branch information...
lovett committed Jun 18, 2019
1 parent d8214a2 commit 10e067db0190a1d46a628207510a8e1c4de34d35
Showing with 10 additions and 10 deletions.
  1. +1 −1 .rsync-filter
  2. +9 −9 Makefile
  3. 0 apps/azure/{test_main.py → main_test.py}
  4. 0 apps/bookmarklets/{test_main.py → main_test.py}
  5. 0 apps/bookmarks/{test_main.py → main_test.py}
  6. 0 apps/bounce/{test_main.py → main_test.py}
  7. 0 apps/calls/{test_main.py → main_test.py}
  8. 0 apps/captures/{test_main.py → main_test.py}
  9. 0 apps/countries/{test_main.py → main_test.py}
  10. 0 apps/coverage/{test_main.py → main_test.py}
  11. 0 apps/geodb/{test_main.py → main_test.py}
  12. 0 apps/grids/{test_main.py → main_test.py}
  13. 0 apps/headers/{test_main.py → main_test.py}
  14. 0 apps/headlines/{test_main.py → main_test.py}
  15. 0 apps/homepage/{test_main.py → main_test.py}
  16. 0 apps/htmlhead/{test_main.py → main_test.py}
  17. 0 apps/ip/{test_main.py → main_test.py}
  18. 0 apps/jenkins/{test_main.py → main_test.py}
  19. 0 apps/later/{test_main.py → main_test.py}
  20. 0 apps/logindex/{test_main.py → main_test.py}
  21. 0 apps/maintenance/{test_main.py → main_test.py}
  22. 0 apps/notification/{test_main.py → main_test.py}
  23. 0 apps/phone/{test_main.py → main_test.py}
  24. 0 apps/redirect/{test_main.py → main_test.py}
  25. 0 apps/registry/{test_main.py → main_test.py}
  26. 0 apps/reminder/{test_main.py → main_test.py}
  27. 0 apps/shared/{test_main.py → main_test.py}
  28. 0 apps/speak/{test_main.py → main_test.py}
  29. 0 apps/startpage/{test_main.py → main_test.py}
  30. 0 apps/transform/{test_main.py → main_test.py}
  31. 0 apps/visitors/{test_main.py → main_test.py}
  32. 0 apps/wakeup/{test_main.py → main_test.py}
  33. 0 apps/weather/{test_main.py → main_test.py}
  34. 0 apps/whois/{test_main.py → main_test.py}
  35. 0 parsers/{test_htmlhead.py → htmlhead_test.py}
  36. 0 parsers/{test_htmltext.py → htmltext_test.py}
  37. 0 parsers/{test_startpage.py → startpage_test.py}
  38. 0 plugins/{test_markup.py → markup_test.py}
  39. 0 plugins/{test_url.py → url_test.py}
@@ -10,7 +10,7 @@
- /coverage
- /.coverage
- /testing
- test_*.py
- *_test.py
- /workspace.sh
- /.rsync-filter
- medley.conf
@@ -13,17 +13,17 @@ APPS := $(filter-out __%,$(APPS))
APPS := $(addprefix apps., $(APPS))

# A list of parsers with test suites in the form "parsers.[name of parser]".
PARSERS := $(wildcard parsers/test_*.py)
PARSERS := $(wildcard parsers/*_test.py)
PARSERS := $(notdir $(PARSERS))
PARSERS := $(basename $(PARSERS))
PARSERS := $(subst test_,,$(PARSERS))
PARSERS := $(subst _test,,$(PARSERS))
PARSERS := $(addprefix parsers., $(PARSERS))

# A list of plugins with test suites in the form "plugins.[name of plugin]".
PLUGINS := $(wildcard plugins/test_*.py)
PLUGINS := $(wildcard plugins/*_test.py)
PLUGINS := $(notdir $(PLUGINS))
PLUGINS := $(basename $(PLUGINS))
PLUGINS := $(subst test_,,$(PLUGINS))
PLUGINS := $(subst _test,,$(PLUGINS))
PLUGINS := $(addprefix plugins., $(PLUGINS))

REQUIREMENTS_PATHS := $(APP_DIR)/requirements*
@@ -177,7 +177,7 @@ test: $(APPS) $(PARSERS) $(PLUGINS) coverage
# Customizing the name of the coverage file allows Make to skip the
# tests if nothing has changed. This is also why the coverage file is
# deleted if the tests fail.
apps.%.cov: apps/%/main.py apps/%/test_main.py
apps.%.cov: apps/%/main.py apps/%/main_test.py
mkdir -p $(COVERAGE_DIR)
COVERAGE_FILE=coverage/$@ \
python -m pytest --cov=apps.$* --cov-branch apps/$* \
@@ -194,10 +194,10 @@ apps.%.cov: apps/%/main.py apps/%/test_main.py
# Customizing the name of the coverage file allows Make to skip the
# tests if nothing has changed. This is also why the coverage file is
# deleted if the tests fail.
parsers.%.cov: parsers/%.py parsers/test_%.py
parsers.%.cov: parsers/%.py parsers/%_test.py
mkdir -p $(COVERAGE_DIR)
COVERAGE_FILE=coverage/$@ \
python -m pytest --cov=parsers.$* --cov-branch parsers/test_$*.py \
python -m pytest --cov=parsers.$* --cov-branch parsers/$*_test.py \
|| rm $(COVERAGE_DIR)/$@


@@ -212,10 +212,10 @@ parsers.%.cov: parsers/%.py parsers/test_%.py
# Customizing the name of the coverage file allows Make to skip the
# tests if nothing has changed. This is also why the coverage file is
# deleted if the tests fail.
plugins.%.cov: plugins/%.py plugins/test_%.py
plugins.%.cov: plugins/%.py plugins/%_test.py
mkdir -p $(COVERAGE_DIR)
COVERAGE_FILE=coverage/$@ \
python -m pytest --cov=plugins.$* --cov-branch plugins/test_$*.py \
python -m pytest --cov=plugins.$* --cov-branch plugins/$*_test.py \
|| rm $(COVERAGE_DIR)/$@


File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 10e067d

Please sign in to comment.
You can’t perform that action at this time.