Mercurial > piecrust2
comparison piecrust/pipelines/records.py @ 979:45ad976712ec
tests: Big push to get the tests to pass again.
- Lots of fixes everywhere in the code.
- Try to handle debug logging in the multiprocessing worker pool when running in pytest. Not perfect, but usable for now.
- Replace all `.md` test files with `.html` since now a auto-format extension always sets the format.
- Replace `out` with `outfiles` in most places since now blog archives are added to the bake output and I don't want to add expected outputs for blog archives everywhere.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 29 Oct 2017 22:51:57 -0700 |
parents | 448710d84121 |
children | 8adc27285d93 |
comparison
equal
deleted
inserted
replaced
978:7e51d14097cb | 979:45ad976712ec |
---|---|
111 def _are_records_valid(multi_record): | 111 def _are_records_valid(multi_record): |
112 return (multi_record._app_version == APP_VERSION and | 112 return (multi_record._app_version == APP_VERSION and |
113 multi_record._record_version == MultiRecord.RECORD_VERSION) | 113 multi_record._record_version == MultiRecord.RECORD_VERSION) |
114 | 114 |
115 | 115 |
116 def load_records(path): | 116 def load_records(path, raise_errors=False): |
117 try: | 117 try: |
118 multi_record = MultiRecord.load(path) | 118 multi_record = MultiRecord.load(path) |
119 except FileNotFoundError: | |
120 if raise_errors: | |
121 raise | |
122 logger.debug("No existing records found at: %s" % path) | |
123 multi_record = None | |
119 except Exception as ex: | 124 except Exception as ex: |
125 if raise_errors: | |
126 raise | |
120 logger.debug("Error loading records from: %s" % path) | 127 logger.debug("Error loading records from: %s" % path) |
121 logger.debug(ex) | 128 logger.debug(ex) |
122 logger.debug("Will use empty records.") | 129 logger.debug("Will use empty records.") |
123 multi_record = None | 130 multi_record = None |
124 | 131 |