From 369ea7ff46df91c61cb0fe1977b4ea41fab31f92 Mon Sep 17 00:00:00 2001 From: mcarton Date: Fri, 26 Jun 2015 14:04:25 +0200 Subject: [PATCH] Add a test.py rule --- README.md | 1 + thefuck/rules/test.py.py | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 thefuck/rules/test.py.py diff --git a/README.md b/README.md index cfd86e34..cddb8f89 100644 --- a/README.md +++ b/README.md @@ -189,6 +189,7 @@ using the matched rule and runs it. Rules enabled by default are as follows: * `sudo` – prepends `sudo` to previous command if it failed because of permissions; * `switch_layout` – switches command from your local layout to en; * `systemctl` – correctly orders parameters of confusing systemctl; +* `test.py` &ndasg; runs `py.test` instead of `test.py`; * `whois` – fixes `whois` command. Enabled by default only on specific platforms: diff --git a/thefuck/rules/test.py.py b/thefuck/rules/test.py.py new file mode 100644 index 00000000..4d232db2 --- /dev/null +++ b/thefuck/rules/test.py.py @@ -0,0 +1,10 @@ +def match(command, settings): + return command.script == 'test.py' and 'not found' in command.stderr + + +def get_new_command(command, settings): + return 'py.test' + + +# make it come before the python_command rule +priority = 900