XZise has uploaded a new change for review.
https://gerrit.wikimedia.org/r/247046
Change subject: [FEAT] Allow tests without tox
......................................................................
[FEAT] Allow tests without tox
To test only one module, class or method it's possible to use a syntax like:
python -m unittest -v tests.test_commit-message-validator
But that does not work if the test is importing the tested module without using
an absolute path.
Change-Id: I9f4fb85928962611ee0dfd4537593c1cf1691458
---
M tests/test_commit-message-validator.py
M tests/test_mw-create-composer-local.py
2 files changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/integration/jenkins
refs/changes/46/247046/1
diff --git a/tests/test_commit-message-validator.py
b/tests/test_commit-message-validator.py
index 6417cba..7cca2fc 100644
--- a/tests/test_commit-message-validator.py
+++ b/tests/test_commit-message-validator.py
@@ -12,7 +12,7 @@
cmv = imp.load_source(
'cmv',
- os.path.dirname(os.path.dirname(__file__)) +
+ os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +
'/tools/commit-message-validator.py')
diff --git a/tests/test_mw-create-composer-local.py
b/tests/test_mw-create-composer-local.py
index dbce092..62ffad4 100644
--- a/tests/test_mw-create-composer-local.py
+++ b/tests/test_mw-create-composer-local.py
@@ -4,7 +4,7 @@
import os
import tempfile
import unittest
-path = os.path.dirname(os.path.dirname(__file__)) \
+path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) \
+ '/bin/mw-create-composer-local.py'
mw_create_composer_local = imp.load_source('mw-create-composer-local', path)
--
To view, visit https://gerrit.wikimedia.org/r/247046
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9f4fb85928962611ee0dfd4537593c1cf1691458
Gerrit-PatchSet: 1
Gerrit-Project: integration/jenkins
Gerrit-Branch: master
Gerrit-Owner: XZise <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits