Skip to content
This repository has been archived by the owner on Oct 3, 2019. It is now read-only.

Commit

Permalink
Remove XML reports
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebrowning committed Apr 14, 2018
1 parent 4b5f7cc commit a51fc75
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 19 deletions.
11 changes: 5 additions & 6 deletions Makefile
Expand Up @@ -77,8 +77,7 @@ COVERAGE := pipenv run coverage
COVERAGE_SPACE := pipenv run coverage.space

RANDOM_SEED ?= $(shell date +%s)
FAILURES := .cache/v/cache/lastfailed
REPORTS ?= xmlreport
FAILURES := .pytest_cache/v/cache/lastfailed

PYTEST_CORE_OPTIONS := -ra -vv
PYTEST_COV_OPTIONS := --cov=$(PACKAGE) --no-cov-on-fail --cov-report=term-missing:skip-covered --cov-report=html
Expand All @@ -96,22 +95,22 @@ test: test-all ## Run unit and integration tests
.PHONY: test-unit
test-unit: install
@ ( mv $(FAILURES) $(FAILURES).bak || true ) > /dev/null 2>&1
$(PYTEST) $(PYTEST_OPTIONS) $(PACKAGE) --junitxml=$(REPORTS)/unit.xml
$(PYTEST) $(PYTEST_OPTIONS) $(PACKAGE)
@ ( mv $(FAILURES).bak $(FAILURES) || true ) > /dev/null 2>&1
$(COVERAGE_SPACE) $(REPOSITORY) unit

.PHONY: test-int
test-int: install
@ if test -e $(FAILURES); then $(PYTEST) $(PYTEST_RERUN_OPTIONS) tests; fi
@ rm -rf $(FAILURES)
$(PYTEST) $(PYTEST_OPTIONS) tests --junitxml=$(REPORTS)/integration.xml
$(PYTEST) $(PYTEST_OPTIONS) tests
$(COVERAGE_SPACE) $(REPOSITORY) integration

.PHONY: test-all
test-all: install
@ if test -e $(FAILURES); then $(PYTEST) $(PYTEST_RERUN_OPTIONS) $(PACKAGES); fi
@ rm -rf $(FAILURES)
$(PYTEST) $(PYTEST_OPTIONS) $(PACKAGES) --junitxml=$(REPORTS)/overall.xml
$(PYTEST) $(PYTEST_OPTIONS) $(PACKAGES)
$(COVERAGE_SPACE) $(REPOSITORY) overall

.PHONY: read-coverage
Expand Down Expand Up @@ -207,7 +206,7 @@ clean-all: clean

.PHONY: .clean-test
.clean-test:
rm -rf .cache .pytest .coverage htmlcov xmlreport
rm -rf .cache .pytest .coverage htmlcov

.PHONY: .clean-docs
.clean-docs:
Expand Down
5 changes: 4 additions & 1 deletion Pipfile
Expand Up @@ -22,10 +22,13 @@ pydocstyle = "*"
# Testing
pytest = "~=3.3"
pytest-describe = "*"
pytest-expecter = "~=1.1"
pytest-expecter = "*"
pytest-random = "*"
pytest-cov = "*"

# Utilities
minilog = "*"

# Reports
coverage-space = "*"

Expand Down
16 changes: 12 additions & 4 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 12 additions & 8 deletions yorm/mapper.py
Expand Up @@ -211,7 +211,7 @@ def load(self):
issubclass(converter, Container):
attr.update_value(data, auto_track=self.auto_track)
else:
log.trace("Converting attribute %r to %r", name, converter)
log.trace("Converting attribute %r using %r", name, converter)
attr = converter.to_value(data)
setattr(self._obj, name, attr)
self._remap(attr, self)
Expand All @@ -228,13 +228,17 @@ def load(self):
setattr(self._obj, name, value)
self._remap(value, self)
else:
if issubclass(converter, Container) and \
not isinstance(existing_attr, converter):
msg = "Converting container attribute %r to %r"
log.trace(msg, name, converter)
value = converter.create_default()
setattr(self._obj, name, value)
self._remap(value, self)
if issubclass(converter, Container):
if isinstance(existing_attr, converter):
pass # TODO: Update 'existing_attr' values to replace None values
else:
msg = "Converting container attribute %r using %r"
log.trace(msg, name, converter)
value = converter.create_default()
setattr(self._obj, name, value)
self._remap(value, self)
else:
pass # TODO: Figure out when this case occurs

# Set meta attributes
self.modified = False
Expand Down

0 comments on commit a51fc75

Please sign in to comment.