gleb-sevruk / pycrunch-engine

NCrunch inspired tool for continuous testing Python
https://pycrunch.com
Other
57 stars 8 forks source link

Can add function and module prefixes in configuration #116

Closed ChristopheDEBOVE closed 5 months ago

ChristopheDEBOVE commented 5 months ago

It would be better if it could be loaded from pytest.ini but I don't know how to do that, maybe in a second time.

gleb-sevruk commented 5 months ago

Looks amazing, I will briefly check it and publish new version.

Can you fix linters also? https://github.com/gleb-sevruk/pycrunch-engine/actions/runs/7831816365/job/21369210660?pr=116#step:6:16

ChristopheDEBOVE commented 5 months ago

Should be ok now for the linters.

gleb-sevruk commented 5 months ago

Works good.

For future reference and documentation update, here is an example of config file

def test_custom_pytest_prefix():
    read_data = '''
engine:
  runtime: simple
  load-pytest-plugins: true
  module-prefixes: test spec
  function-prefixes: should must

discovery:
  exclusions:
   - directory_1
   - directory_2
mode: manual

'''
    with mock.patch('io.open', mock_open(read_data=read_data)) as x:
        sut = create_sut()
        sut.load_runtime_configuration()
        assert sut.module_prefixes == ['test', 'spec']
        assert sut.function_prefixes == ['should', 'must']
gleb-sevruk commented 5 months ago

@ChristopheDEBOVE Version 1.6.4 is published including fixes here

please try via pip install pycrunch-engine --upgrade