-
-
-
-
This is only true if running on Windows. A better comment would be something like: "If the test files are executable on the file system, nose will need the --exe argument to run them."
-
Blank line before the if statement.
Instead of
os.getcwd(), it's best to be explicit about file paths. You also don't want to assume path separators (which is the whole reason to useos.path.join). This should look more like:os.path.join(os.path.dirname(__file__), 'djblets', 'settings.py' ....) -
We use parens for multi-line if statements. This should be more like:
if (os.path.exists(...) and (os.stat(...) & ...)):Note also that you shouldn't need to cast to bool.
Run unit tests from executable Python modules
Review Request #5325 — Created Jan. 27, 2014 and submitted
Run unit tests from executable Python modules
When developing on a Linux VM inside a Windows host, all Python modules have the executable flag on. Nose has work around for this when run on Windows (https://github.com/nose-devs/nose/blob/master/nose/config.py#L26). In this case, the Python intrepeter run inside the VM causing the work-around to fail. This review request adds check for executable file permission and forces Nose to run tests.
Unit tests pass.
| Description | From | Last Updated |
|---|---|---|
|
Make sure the import is listed alphabetically. |
|
|
|
Need to keep two blank lines between these. |
|
|
|
This is only true if running on Windows. A better comment would be something like: "If the test files are … |
|
|
|
Blank line before the if statement. Instead of os.getcwd(), it's best to be explicit about file paths. You also don't … |
|
|
|
We use parens for multi-line if statements. This should be more like: if (os.path.exists(...) and (os.stat(...) & ...)): Note also … |
|
|
|
You have some trailing whitespace on these lines (where it highlights in red in the diff viewer). |
|
|
|
Can you indent 'settings.py' to line up with os.path.dirname? |
|