summaryrefslogtreecommitdiff
path: root/tests/test_loader.py
Commit message (Collapse)AuthorAgeFilesLines
* support pathlib in FileSystemLoader and ModuleLoaderAlex Chan2019-10-211-8/+93
|
* PackageLoader doesn't depend on setuptoolsDavid Lord2019-10-171-7/+58
|
* skip template with same name as directoryDavid Lord2019-10-131-0/+11
| | | | | | When using multiple paths with FileSystemLoader, a template with the same name as a directory will not prevent loading a template in the directory.
* Bump up the copyright to 2017Armin Ronacher2017-01-071-1/+1
|
* Cleaned up shitty syntax in testsuiteArmin Ronacher2017-01-061-2/+2
|
* Change environment cache key constructionpgjones2016-05-211-3/+5
| | | | | | | | | Changing from a tuple of the loader ID and template name to a weakref to the loader and the template name should avoid situations whereby the loader has changed, yet the cached templates are returned. This would occur if the id of the new loader matches the old. A weakref is preferred over a direct reference so that the loader can be garbaged collected.
* Change cache key definitiion in environmentpgjones2016-05-191-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | In 6671b973e6de5abc46829a27fd3bbb989d68ca3a the load_template method was altered to use a cache key other than the template name. The key chosen was the abs path as returned from the loader get_source method. Unless there is no path in which case the name is used. Unfortunately this introduced a performance regression, #485, as the get_source method (in the FileStoreLoader) loads the template (causing IO). The purpose of #332 was to allow the loader to change whilst ensuring the correct template was loaded, i.e. to fix this case env.loader = loader1 env.get_template('index.html') # return loader1/index.html env.loader = loader2 env.get_template('index.html') # also return loader1/index.html because of cache This commit changes the cache key to be a tuple of the id(loader) and the template name. Therefore fixing the above case without calling the get_source method and thereby avoiding the IO load. A test has been added to ensure the above case works as expected, this required a minor refactor of the caching tests.
* Rename testsuite to tests and suggestionsKartheek Lenkala2015-03-221-0/+220
Remove py.test from setup.py install_requires Rename testsuite folder to tests.