Code Monkey home page Code Monkey logo

pymutester's People

Contributors

miketeo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pymutester's Issues

PyMuTester crash!

@miketeo Is the below error a usage issue or an existing bug?

$ mutant-nosetests --mutant-path bitstring-master/ -w bitstring-master/test/
...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Ran 483 tests in 39.871s

OK


Starting mutation test...


Traceback (most recent call last):
File "C:/Python27/Scripts/mutant-nosetests", line 4, in
import('pkg_resources').run_script('pymutester==0.1.1', 'mutant-nosetests')
File "C:\Python27\lib\site-packages\pkg_resources_init_.py", line 742, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "C:\Python27\lib\site-packages\pkg_resources_init_.py", line 1497, in run_script
exec(code, namespace, namespace)
File "c:\python27\lib\site-packages\pymutester-0.1.1-py2.7.egg\EGG-INFO\scripts\mutant-nosetests", line 7, in
main()
File "C:\Python27\lib\site-packages\pymutester-0.1.1-py2.7.egg\mutester\nose_main.py", line 52, in main
source_function_names[source_filename] = generate_function_names(source_filename)
File "C:\Python27\lib\site-packages\pymutester-0.1.1-py2.7.egg\mutester\util.py", line 54, in generate_function_names
with open(source_filename, 'rU') as fh:
IOError: [Errno 22] invalid mode ('rU') or filename: ''

Crash iterating over sys.modules: RuntimeError: dictionary changed size during iteration

I just tried mutester for the first time. It crashed right out of the gate:

$ PYTHONPATH=lib mutant-nosetests --mutant-path $PWD/lib -w tests
...........
----------------------------------------------------------------------
Ran 11 tests in 1.455s

OK

*************************
Starting mutation test...
*************************
Traceback (most recent call last):
  File "/var/lib/venv/renesys/bin/mutant-nosetests", line 7, in 
    main()
  File "/var/lib/venv/renesys/local/lib/python2.7/site-packages/mutester/nose_main.py", line 36, in main
    for module_name, module in sys.modules.iteritems():
RuntimeError: dictionary changed size during iteration

pymutester fails on missing parentheses in exec

I just installed pymutester with pip3 install pymutester. This worked (seemingly), but gave an error:

$ pip3 install pymutester                                                            
Downloading/unpacking pymutester
  Downloading pymutester-0.1.0.tar.gz
  Running setup.py (path:/private/var/folders/rz/zjrxrqhd3952q45ssdzms0_40000gn/T/pip_build_ferriera/pymutester/setup.py) egg_info for package pymutester

Requirement already satisfied (use --upgrade to upgrade): nose>=0.11.4 in /usr/local/lib/python3.4/site-packages (from pymutester)
Installing collected packages: pymutester
  Running setup.py install for pymutester
    changing mode of build/scripts-3.4/mutant-nosetests from 600 to 755
      File "/usr/local/lib/python3.4/site-packages/mutester/importer.py", line 28
        exec self.override_code in mod.__dict__
                ^
    SyntaxError: Missing parentheses in call to 'exec'


    changing mode of /usr/local/bin/mutant-nosetests to 755
Successfully installed pymutester
Cleaning up...

When I try to execute mutant-nosetests, I get the same error.

Perhaps pymutester doesn't support Python 3?

tests fail: "AssertionError: Test output is different"

I just tried to run pymutester's own unit tests. Not good:

$ nosetests
....F
======================================================================
FAIL: test_cfgparser (tests.test_nosemain.NoseMainTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/src/PyMuTester/tests/test_nosemain.py", line 43, in test_cfgparser
    assert not diff_lines, 'Test output is different\n\n' + ''.join(diff_lines)
AssertionError: Test output is different

--- Expected Output
+++ Test Output
@@ -1,130 +0,0 @@
-Starting mutation test...
-*************************
-Mutating ParsingError.__init__ (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:206)...
-Mutating NoOptionError.__init__ (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:161)...
-Mutating ParsingError.append (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:211)...
-Mutating RawConfigParser.has_option (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:373)...
-*** IFNOT-1... Mutant killed
-*** IFNOT-2... Mutant killed
-Mutating DuplicateSectionError.__init__ (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:154)...
-Mutating InterpolationDepthError.__init__ (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:195)...
-Mutating RawConfigParser.readfp (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:307)...
-*** IFNOT-1... Mutant killed
-Mutating RawConfigParser._read (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:462)...
-*** IFNOT-1... Mutant killed
-*** IFNOT-2... Mutant killed
-*** IFNOT-3... Mutant killed
-*** IFNOT-4... Mutant killed
-*** IFNOT-5... Mutant killed
-*** IFNOT-6... Mutant killed
-*** IFNOT-7... Mutant killed
-*** IFNOT-8... Mutant killed
-*** IFNOT-9... Mutant killed
-*** IFNOT-10... Mutant killed
-*** IFNOT-11... Mutant killed
-*** IFNOT-12... Mutant killed
-*** IFNOT-13... Mutant killed
-*** IFNOT-14... Mutant killed
-*** IFNOT-15... Mutant killed
-*** IFNOT-16... Mutant killed
-*** SKIPLOOP-1... Mutant killed
-Mutating RawConfigParser.add_section (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:250)...
-*** IFNOT-1... Mutant killed
-*** IFNOT-2... Mutant killed
-Mutating RawConfigParser.read (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:282)...
-*** IFNOT-1... Mutant killed
-*** SKIPLOOP-1... Mutant killed
-Mutating RawConfigParser.set (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:385)...
-*** IFNOT-1... Mutant killed
-Mutating NoSectionError.__init__ (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:147)...
-Mutating RawConfigParser.remove_option (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:414)...
-*** IFNOT-1... Mutant killed
-*** IFNOT-2... Mutant killed
-Mutating InterpolationError.__init__ (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:170)...
-Mutating RawConfigParser.sections (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:245)...
-Mutating RawConfigParser.has_section (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:264)...
-Mutating Error._set_message (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:125)...
-Mutating SafeConfigParser._interpolate_some (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:649)...
-*** IFNOT-1... Mutant killed
-*** IFNOT-2... Mutant killed
-*** IFNOT-3... Mutant killed
-*** IFNOT-4... Mutant killed
-*** IFNOT-5... Mutant killed
-*** IFNOT-6... Mutant killed
-*** IFNOT-7... Mutant killed
-*** SKIPLOOP-1... Mutant killed
-Mutating RawConfigParser.optionxform (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:370)...
-Mutating MissingSectionHeaderError.__init__ (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:218)...
-Mutating RawConfigParser.write (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:396)...
-*** IFNOT-1... Mutant killed
-*** IFNOT-2... Mutant killed
-*** IFNOT-3... Mutant killed
-*** SKIPLOOP-1... Mutant killed
-*** SKIPLOOP-2... Mutant killed
-*** SKIPLOOP-3... Mutant killed
-Mutating RawConfigParser.__init__ (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:229)...
-*** IFNOT-1... Mutant killed
-*** IFNOT-2... Mutant killed
-*** SKIPLOOP-1... Mutant killed
-Mutating RawConfigParser.options (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:271)...
-*** IFNOT-1... Mutant killed
-Mutating InterpolationMissingOptionError.__init__ (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:178)...
-Mutating Error.__init__ (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:135)...
-Mutating RawConfigParser.getboolean (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:364)...
-*** IFNOT-1... Mutant killed
-Mutating Error._get_message (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:120)...
-Mutating ConfigParser.items (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:578)...
-*** IFNOT-1... Mutant not reached
---- /home/pip/PyMuTester/tests/mock_modules/ConfigParser.py (original)
-+++ /home/pip/PyMuTester/tests/mock_modules/ConfigParser.py (mutant-IFNOT-1)
-@@ -591,7 +591,8 @@
-         try:
-             d.update(self._sections[section])
-         except KeyError:
--            if section != DEFAULTSECT:
-+            if (not (section != DEFAULTSECT)):
-                 raise NoSectionError(section)
-         # Update with the entry specific variables
-         if vars:
-*** IFNOT-2... Mutant killed
-*** IFNOT-3... Mutant killed
-*** IFNOT-4... Mutant killed
-*** SKIPLOOP-1... Mutant not reached
---- /home/pip/PyMuTester/tests/mock_modules/ConfigParser.py (original)
-+++ /home/pip/PyMuTester/tests/mock_modules/ConfigParser.py (mutant-SKIPLOOP-1)
-@@ -595,7 +595,9 @@
-                 raise NoSectionError(section)
-         # Update with the entry specific variables
-         if vars:
--            for key, value in vars.items():
-+            for (key, value) in vars.items():
-+                if mutest_statement_reached() % 2 == 0: continue
-                 d[self.optionxform(key)] = value
-         options = d.keys()
-         if "__name__" in options:
-Mutating SafeConfigParser.set (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:687)...
-*** IFNOT-1... Mutant killed
-*** IFNOT-2... Mutant killed
-*** IFNOT-3... Mutant killed
-Mutating ConfigParser.get (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:546)...
-*** IFNOT-1... Mutant killed
-*** IFNOT-2... Mutant killed
-*** IFNOT-3... Mutant killed
-*** SKIPLOOP-1... Mutant not reached
---- /home/pip/PyMuTester/tests/mock_modules/ConfigParser.py (original)
-+++ /home/pip/PyMuTester/tests/mock_modules/ConfigParser.py (mutant-SKIPLOOP-1)
-@@ -562,7 +562,9 @@
-                 raise NoSectionError(section)
-         # Update with the entry specific variables
-         if vars:
--            for key, value in vars.items():
-+            for (key, value) in vars.items():
-+                if mutest_statement_reached() % 2 == 0: continue
-                 d[self.optionxform(key)] = value
-         option = self.optionxform(option)
-         try:
-Mutating SafeConfigParser._interpolate (/home/pip/PyMuTester/tests/mock_modules/ConfigParser.py:641)...
-
-Mutant Test Results
-Total: 58
-   Alive: 0 (0.0%) Killed: 55 (94.8%)  Unreachable: 3 (5.2%)


----------------------------------------------------------------------
Ran 5 tests in 0.215s

FAILED (failures=1)

This is Python 2.7.6 on Ubuntu 14.04.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.