From a720baf407bcca2e3f5967d02a84b6d1a8131693 Mon Sep 17 00:00:00 2001 From: Tobi-wan Kenobi Date: Sat, 3 Dec 2016 20:45:52 +0100 Subject: [PATCH] [tests] Add Python3 test run Add testrun to also verify Python3 functionality. + Immediately fix a Python3 incompatibility. see #23 --- bumblebee/config.py | 2 +- runtests.sh | 4 +++- tests/test_config.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bumblebee/config.py b/bumblebee/config.py index d9c9419..d33219c 100644 --- a/bumblebee/config.py +++ b/bumblebee/config.py @@ -8,7 +8,7 @@ class Config(object): self._args = parser.parse_args(args) def modules(self): - return map(lambda x: { "name": x, "module": x }, self._args.modules) + return list(map(lambda x: { "name": x, "module": x }, self._args.modules)) def _create_parser(self): parser = argparse.ArgumentParser(description="display system data in the i3bar") diff --git a/runtests.sh b/runtests.sh index 58521b5..089f936 100755 --- a/runtests.sh +++ b/runtests.sh @@ -1,3 +1,5 @@ #!/bin/sh -nosetests --rednose -v tests/ +test=$(which nosetests) +python2 $test --rednose -v tests/ +python3 $test --rednose -v tests/ diff --git a/tests/test_config.py b/tests/test_config.py index 66fd1d8..d344932 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -13,6 +13,6 @@ class TestConfig(unittest.TestCase): def test_load_simple_modules(self): cfg = Config([ "-m" ] + self.someSimpleModules) self.assertEquals(cfg.modules(), - map(lambda x: { "name": x, "module": x }, self.someSimpleModules)) + list(map(lambda x: { "name": x, "module": x }, self.someSimpleModules))) # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4