기본 코 구성 파일의 이름을 지정하는 것과 다른 방식으로 구성 파일의 이름을 지정하는 것 같습니다. nose.config
config_files = [
# Linux users will prefer this
"~/.noserc",
# Windows users will prefer this
"~/nose.cfg"
]
def user_config_files():
"""Return path to any existing user config files
"""
return filter(os.path.exists,
map(os.path.expanduser, config_files))
def all_config_files():
"""Return path to any existing user config files, plus any setup.cfg
in the current working directory.
"""
user = user_config_files()
if os.path.exists('setup.cfg'):
return user + ['setup.cfg']
return user
이의 짧은에서
, 즉 코는 ~/.noserc 또는 ~/nose.cfg라는 이름의 기본 구성 파일을 찾고 있습니다. 그들이 코와 같이 이름이 지정되지 않은 경우이를 선택하지 않아야합니다. 을 직접 입력해야합니다.은 명령 줄에서 수행하는 것처럼 구성 파일의 이름을 지정합니다.
이제 예를 들어 다음 설정 파일 이름을 얻을 수있는 가장 좋은 방법 nose.config.Config의 예를입니다 오브젝트 설정는`) (당신이`nose.config.user_config_files를 시도
>>> from nose.config import Config
>>> c = Config()
>>> c.configure(argv=["nosetests", "-c", "foo.txt"])
>>> c.options.files
['foo.txt']
말을하는 것입니다 또는'nose.config.all_config_files()'? –
나는 둘 다 비어있다. – sowa