Made tests in PyCharm work

pull/265/head
sezanzeb 2 years ago
parent bb1af00a63
commit 60960aa095

@ -0,0 +1,16 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Tests" type="tests" factoryName="Autodetect">
<module name="input-remapper" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;$PROJECT_DIR$/tests/testcases&quot;" />
<option name="_new_targetType" value="&quot;PATH&quot;" />
<method v="2" />
</configuration>
</component>

@ -0,0 +1,2 @@
# make sure patches are loaded
import tests.test

@ -23,6 +23,9 @@
import os
import sys
# the working directory should be the project root
assert not os.getcwd().endswith("tests")
# make sure the "tests" module visible
sys.path.append(os.getcwd())
if __name__ == "__main__":
@ -51,10 +54,7 @@ gi.require_version("Gtk", "3.0")
gi.require_version("GLib", "2.0")
gi.require_version("GtkSource", "4")
from xmodmap import xmodmap
assert not os.getcwd().endswith("tests")
from tests.xmodmap import xmodmap
os.environ["UNITTEST"] = "1"
@ -660,9 +660,10 @@ def spy(obj, name):
return patch.object(obj, name, wraps=obj.__getattribute__(name))
def main():
cleanup()
cleanup()
def main():
modules = sys.argv[1:]
# discoverer is really convenient, but it can't find a specific test
# in all of the available tests like unittest.main() does...,

Loading…
Cancel
Save