-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Surpress locales warning for test runs
- Loading branch information
Showing
6 changed files
with
27 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ then | |
PYTHON=python3 | ||
fi | ||
|
||
$PYTHON -m unittest discover tests | ||
$PYTHON tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
@echo off | ||
|
||
rem assume that python is on the path | ||
rem echo "Executing tests (will only work if Python is on the path)" | ||
rem echo "Executing tests (will only work if Python is on the PATH)" | ||
|
||
python -m unittest discover tests | ||
python tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# mock out warning registry | ||
import os, sys | ||
|
||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | ||
|
||
import MAGSBS | ||
import unittest, unittest.mock | ||
# Running tests will load the built-in MAGSBS localisation support which is not | ||
# available during test runtime. Hence it's better mocked out. For the few rare | ||
# cases where the warning registry is under test, the mock can be added using a | ||
# patch to the test function. | ||
|
||
with unittest.mock.patch('MAGSBS.common.WarningRegistry'): | ||
import unittest | ||
sys.argv.append('discover') | ||
sys.argv.append('tests') | ||
unittest.TestProgram(module=None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters