summary refs log tree commit diff stats
diff options
context:
space:
mode:
authornfnty <git@nfnty.se>2017-01-24 05:42:08 +0100
committernfnty <git@nfnty.se>2017-01-24 05:45:56 +0100
commitc5f776edfa1fe1ddf8027a6acec7b1caee8e9867 (patch)
tree1df9952c2f5d66c56c1448eac16e54183ad28784
parent94dc542c80d56afd2edf9c80e5f4031770920f94 (diff)
downloadranger-c5f776edfa1fe1ddf8027a6acec7b1caee8e9867.tar.gz
Makefile: Split tests
-rw-r--r--HACKING.md15
-rw-r--r--Makefile18
2 files changed, 19 insertions, 14 deletions
diff --git a/HACKING.md b/HACKING.md
index b8f62d86..57ac90e6 100644
--- a/HACKING.md
+++ b/HACKING.md
@@ -7,10 +7,11 @@ Coding Style
 * Use syntax compatible with Python `2.6+` and `3.1+`.
 * Use docstrings with `pydoc` in mind
 * Follow the PEP8 style guide: https://www.python.org/dev/peps/pep-0008/
-* Always run `make test` before submitting a new PR. `pylint` and `flake8` needs to be installed.
+* Always run `make test` before submitting a new PR. `pylint`, `flake8` and
+  `pytest` needs to be installed.
 * When breaking backward compatibility with old configuration files or plugins,
   please include a temporary workaround code that provides a compatibility
-  layer and mark it with a comment that includes the word `COMPAT`.  For
+  layer and mark it with a comment that includes the word `COMPAT`. For
   examples, grep the code for the word `COMPAT`. :)
 
 
@@ -23,7 +24,7 @@ Send patches, created with `git format-patch`, to the email address
 
 or open a pull request on GitHub.
 
-Please use PGP-encryption for security-relevand patches or messages.  The UIDs
+Please use PGP-encryption for security-relevand patches or messages. The UIDs
 of my key are `huterich <hut@lavabit.com>` and `hut <hut@hut.pm>`, my
 fingerprint is `1E9B 36EC 051F F6F7 FFC9 69A7 F08C E1E2 00FB 5CDF` and my full
 pubkey is at the very bottom of this file.
@@ -73,7 +74,7 @@ Adding colorschemes
 -------------------
 
 * Copy `ranger/colorschemes/default.py` to `ranger/colorschemes/myscheme.py`
-  and modify it according to your needs.  Alternatively, create a subclass of
+  and modify it according to your needs. Alternatively, create a subclass of
   `ranger.colorschemes.default.Default` and override the `use` method, as it is
   done in the `Jungle` colorscheme.
 
@@ -84,14 +85,14 @@ Adding colorschemes
 Change which programs start which file types
 --------------------------------------------
 
-Edit the configuration file `~/.config/ranger/rifle.conf`.  The default one can
+Edit the configuration file `~/.config/ranger/rifle.conf`. The default one can
 be obtained by running `ranger --copy-config rifle`.
 
 
 Change which file extensions have which mime type
 -------------------------------------------------
 
-Modify `ranger/data/mime.types`.  You may also add your own entries to `~/.mime.types`
+Modify `ranger/data/mime.types`. You may also add your own entries to `~/.mime.types`
 
 
 Change which files are previewed in the auto preview
@@ -104,7 +105,7 @@ PGP key
 =======
 
 You may wish to send the author (`hut@hut.pm`) PGP-encrypted mails for
-security-relevant messages.  This is the authors key.  Save everything from the
+security-relevant messages. This is the authors key. Save everything from the
 `BEGIN PGP PUBLIC KEY BLOCK` up until the `END PGP PUBLIC KEY BLOCK` message
 into a file and import it with `gpg --import <filename>`.
 
diff --git a/Makefile b/Makefile
index cd871d2e..f31053e4 100644
--- a/Makefile
+++ b/Makefile
@@ -67,23 +67,27 @@ TEST_PATHS_MAIN = \
 	tests
 TEST_PATH_CONFIG = ranger/config
 
-test:
+test_pylint:
 	@echo "Running pylint..."
 	pylint $(TEST_PATHS_MAIN)
 	pylint --rcfile=$(TEST_PATH_CONFIG)/pylintrc $(TEST_PATH_CONFIG)
+
+test_flake8:
 	@echo "Running flake8..."
 	flake8 $(TEST_PATHS_MAIN) $(TEST_PATH_CONFIG)
+
+test_doctest:
 	@echo "Running doctests..."
 	@for FILE in $(shell grep -IHm 1 doctest -r ranger | grep $(FILTER) | cut -d: -f1); do \
 		echo "Testing $$FILE..."; \
 		RANGER_DOCTEST=1 PYTHONPATH=".:"$$PYTHONPATH ${PYTHON} $$FILE; \
 	done
-	@if type py.test > /dev/null; then \
-		echo "Running py.test tests..."; \
-		py.test tests; \
-	else \
-		echo "WARNING: Couldn't run some tests because py.test is not installed!"; \
-	fi
+
+test_pytest:
+	echo "Running py.test tests..."
+	py.test tests
+
+test: test_pylint test_flake8 test_doctest test_pytest
 	@echo "Finished testing."
 
 man: