croach / Flask-Fixtures

A simple library for adding database fixtures for unit tests using nothing but JSON or YAML.
MIT License
63 stars 30 forks source link

About fixtures directory set problem #24

Open yaoelvon opened 8 years ago

yaoelvon commented 8 years ago

When I set app.config['FIXTURES_DIRS'], FIXTURES_DIRS path and "current_app.root_path + '/fixtures'" together have a same file 'author.json', flask-fixtures will get "current_app.root_path + '/fixtures/author.json'" file. I think that default can use "current_app.root_path + '/fixtures'", but we shoud use app.config['FIXTURES_DIRS'] when I had set "app.config['FIXTURES_DIRS']".

yaoelvon commented 8 years ago

Why CI build failed? I run 'nosetests' local successfully.

➜  Flask-Fixtures git:(master) nosetests
/Library/Python/2.7/site-packages/flask_sqlalchemy/__init__.py:800: UserWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future.  Set it to True to suppress this warning.
  warnings.warn('SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future.  Set it to True to suppress this warning.')
..........
----------------------------------------------------------------------
Ran 10 tests in 0.296s

OK

And I have do following:

    def tearDown(self):
        app.config.pop('FIXTURES_DIRS')
        self.app_context.pop()