Python sys.py() Examples

The following are code examples for showing how to use sys.py(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
Project: NiujiaoDebugger   Author: MrSrc   File: test_modulefinder.py    GNU General Public License v3.0 5 votes vote down vote up
def test_replace_paths(self):
        old_path = os.path.join(TEST_DIR, 'a', 'module.py')
        new_path = os.path.join(TEST_DIR, 'a', 'spam.py')
        with support.captured_stdout() as output:
            self._do_test(maybe_test, debug=2,
                          replace_paths=[(old_path, new_path)])
        output = output.getvalue()
        expected = "co_filename %r changed to %r" % (old_path, new_path)
        self.assertIn(expected, output) 
Example 2
Project: NiujiaoDebugger   Author: MrSrc   File: test_modulefinder.py    GNU General Public License v3.0 5 votes vote down vote up
def test_extended_opargs(self):
        extended_opargs_test = [
            "a",
            ["a", "b"],
            [], [],
            """\
a.py
                                %r
                                import b
b.py
""" % list(range(2**16))]  # 2**16 constants
        self._do_test(extended_opargs_test) 
Example 3
Project: ironpython2   Author: IronLanguages   File: test_modulefinder.py    Apache License 2.0 5 votes vote down vote up
def test_extended_opargs(self):
        extended_opargs_test = [
            "a",
            ["a", "b"],
            [], [],
            """\
a.py
                                %r
                                import b
b.py
""" % range(2**16)]  # 2**16 constants
        self._do_test(extended_opargs_test) 
Example 4
Project: Blockly-rduino-communication   Author: technologiescollege   File: test_modulefinder.py    GNU General Public License v3.0 5 votes vote down vote up
def test_replace_paths(self):
        old_path = os.path.join(TEST_DIR, 'a', 'module.py')
        new_path = os.path.join(TEST_DIR, 'a', 'spam.py')
        with support.captured_stdout() as output:
            self._do_test(maybe_test, debug=2,
                          replace_paths=[(old_path, new_path)])
        output = output.getvalue()
        expected = "co_filename %r changed to %r" % (old_path, new_path)
        self.assertIn(expected, output) 
Example 5
Project: cqp-sdk-for-py37-native   Author: crud-boy   File: test_modulefinder.py    GNU General Public License v2.0 5 votes vote down vote up
def test_replace_paths(self):
        old_path = os.path.join(TEST_DIR, 'a', 'module.py')
        new_path = os.path.join(TEST_DIR, 'a', 'spam.py')
        with support.captured_stdout() as output:
            self._do_test(maybe_test, debug=2,
                          replace_paths=[(old_path, new_path)])
        output = output.getvalue()
        expected = "co_filename %r changed to %r" % (old_path, new_path)
        self.assertIn(expected, output) 
Example 6
Project: cqp-sdk-for-py37-native   Author: crud-boy   File: test_modulefinder.py    GNU General Public License v2.0 5 votes vote down vote up
def test_extended_opargs(self):
        extended_opargs_test = [
            "a",
            ["a", "b"],
            [], [],
            """\
a.py
                                %r
                                import b
b.py
""" % list(range(2**16))]  # 2**16 constants
        self._do_test(extended_opargs_test) 
Example 7
Project: Project-New-Reign---Nemesis-Main   Author: ShikyoKira   File: test_modulefinder.py    GNU General Public License v3.0 5 votes vote down vote up
def test_replace_paths(self):
        old_path = os.path.join(TEST_DIR, 'a', 'module.py')
        new_path = os.path.join(TEST_DIR, 'a', 'spam.py')
        with support.captured_stdout() as output:
            self._do_test(maybe_test, debug=2,
                          replace_paths=[(old_path, new_path)])
        output = output.getvalue()
        expected = "co_filename %r changed to %r" % (old_path, new_path)
        self.assertIn(expected, output) 
Example 8
Project: Project-New-Reign---Nemesis-Main   Author: ShikyoKira   File: test_modulefinder.py    GNU General Public License v3.0 5 votes vote down vote up
def test_extended_opargs(self):
        extended_opargs_test = [
            "a",
            ["a", "b"],
            [], [],
            """\
a.py
                                %r
                                import b
b.py
""" % list(range(2**16))]  # 2**16 constants
        self._do_test(extended_opargs_test) 
Example 9
Project: cells   Author: AlesTsurko   File: test_modulefinder.py    MIT License 5 votes vote down vote up
def test_replace_paths(self):
        old_path = os.path.join(TEST_DIR, 'a', 'module.py')
        new_path = os.path.join(TEST_DIR, 'a', 'spam.py')
        with support.captured_stdout() as output:
            self._do_test(maybe_test, debug=2,
                          replace_paths=[(old_path, new_path)])
        output = output.getvalue()
        expected = "co_filename %r changed to %r" % (old_path, new_path)
        self.assertIn(expected, output) 
Example 10
Project: cells   Author: AlesTsurko   File: test_modulefinder.py    MIT License 5 votes vote down vote up
def test_extended_opargs(self):
        extended_opargs_test = [
            "a",
            ["a", "b"],
            [], [],
            """\
a.py
                                %r
                                import b
b.py
""" % list(range(2**16))]  # 2**16 constants
        self._do_test(extended_opargs_test)