sixty-north / cosmic-ray

Mutation testing for Python
MIT License
565 stars 57 forks source link

Adding ASTQuery #468

Closed Alcolo47 closed 5 years ago

Alcolo47 commented 5 years ago

ObjTest alone

boxed commented 5 years ago

Is this trying to solve the same problem as the ASTPattern class in mutmut? https://github.com/boxed/mutmut/blob/master/tests/test_mutation.py#L29 i.e. matching complex patterns on the AST.

It would be interesting to write the patterns we want to match using both systems and comparing how they read if so.

abingham commented 5 years ago

This looks mostly fine to me. The only change I'd like is to put the code into its own module. ObjTest is closely associated with the AST, so I propose this:

  1. Make ast.py into a package. ast/__init__.py can expose all of the same stuff it does today.
  2. Put the ObjTest implementation into ast/obj_test.py.

With that, I think everything would be good.

Alcolo47 commented 5 years ago

OK, I will move this class. But about its name, I was not inspired, maybe AstTester ?

abingham commented 5 years ago

maybe AstTester?

How about ASTQuery? It seems like it's primarily for querying for subsets of an AST.

abingham commented 5 years ago

If you can fix the breaking tests, then I can merge this in.