Como um parâmetro oculto pode ser adicionado a um programa quando não há um alias de shell?

0

py.test acha que existe um argumento -n quando não há nenhum. O que poderia estar adicionando isso? O programa funciona como esperado no OS X, mas não no Ubuntu 16.04.

Eu verifiquei um número de possibilidades, aliases, tentei zsh, sh, mas sem sorte.

± /usr/local/bin/py.test
usage: py.test [options] [file_or_dir] [file_or_dir] [...]
py.test: error: unrecognized arguments: -n
  inifile: /home/ahundt/src/keras/pytest.ini
  rootdir: /home/ahundt/src/keras
-> [2]
± sh
$ /usr/local/bin/py.test
usage: py.test [options] [file_or_dir] [file_or_dir] [...]
py.test: error: unrecognized arguments: -n
  inifile: /home/ahundt/src/keras/pytest.ini
  rootdir: /home/ahundt/src/keras
$ /usr/local/bin/py.test tests/
usage: py.test [options] [file_or_dir] [file_or_dir] [...]
py.test: error: unrecognized arguments: -n tests/
  inifile: /home/ahundt/src/keras/pytest.ini
  rootdir: /home/ahundt/src/keras
$ exit
-> [2]
ahundt@femur|~/src/keras on tfrecord!?
± pip2 install --upgrade pytest
Collecting pytest
  Downloading pytest-3.2.1-py2.py3-none-any.whl (186kB)
    100% |████████████████████████████████| 194kB 6.4MB/s 
Requirement already up-to-date: setuptools in /usr/local/lib/python2.7/dist-packages (from pytest)
Requirement already up-to-date: py>=1.4.33 in /usr/local/lib/python2.7/dist-packages (from pytest)
Installing collected packages: pytest
  Found existing installation: pytest 3.1.2
    Uninstalling pytest-3.1.2:
      Successfully uninstalled pytest-3.1.2
Successfully installed pytest-3.2.1
ahundt@femur|~/src/keras on tfrecord!?
Requirement already up-to-date: pytest in /usr/local/lib/python2.7/dist-packages
Requirement already up-to-date: setuptools in /usr/local/lib/python2.7/dist-packages (from pytest)
Requirement already up-to-date: py>=1.4.33 in /usr/local/lib/python2.7/dist-packages (from pytest)
± pip3 install --upgrade --user pytest
Collecting pytest
  Using cached pytest-3.2.1-py2.py3-none-any.whl
Collecting setuptools (from pytest)
  Using cached setuptools-36.2.7-py2.py3-none-any.whl
Collecting py>=1.4.33 (from pytest)
  Using cached py-1.4.34-py2.py3-none-any.whl
Installing collected packages: setuptools, py, pytest
Successfully installed py-1.4.34 pytest-3.2.1 setuptools-36.2.7
± py.test tests/
usage: py.test [options] [file_or_dir] [file_or_dir] [...]
py.test: error: unrecognized arguments: -n tests/
  inifile: /home/ahundt/src/keras/pytest.ini
  rootdir: /home/ahundt/src/keras
± type py.test
py.test is /usr/local/bin/py.test
py.test is /home/ahundt/.local/bin/py.test
ahundt@femur|~/src/keras on tfrecord!?
± type /home/ahundt/.local/bin/py.test
/home/ahundt/.local/bin/py.test is /home/ahundt/.local/bin/py.test
    
por Andrew Hundt 17.08.2017 / 02:06

1 resposta

1

Existe tal argumento, nomeadamente em pytest.ini .

# Configuration of py.test
[pytest]
addopts=-v
        -n 2
        --durations=20

pytest.ini arquiva a configuração do armazenamento para sua configuração do pytest. Portanto, em vez de fornecer muitas opções de linha de comando, você pode simplesmente digitar pytest e todas as propriedades serão coletadas (cobertura de teste, lintagem, etc.).

Se você remover a linha -n 2 , os testes ainda serão executados. Espero que isso ajude.

    
por 15.06.2018 / 10:55