Skip to content

Conversation

@albertsola
Copy link
Contributor

No description provided.

testpaths = "tests"
pythonpath = "."
addopts = "--cov=mpt_api_client --cov-report=term-missing --cov-report=html --cov-report=xml"
addopts = "--cov=mpt_api_client --cov-report=term-missing --cov-report=html --cov-report=xml --import-mode=importlib"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you clarify reasons to change import-mode?

Copy link
Contributor Author

@albertsola albertsola Sep 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the current setup, you can't have tests files with the same name.

import file mismatch:
imported module 'test_mixins' has this __file__ attribute:                                                                          
  /mpt_api_client/tests/http/test_mixins.py                                                                                         
which is not the same as the test file we want to collect:                                                                          
  /mpt_api_client/tests/resources/commerce/test_mixins.py                                                                           
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules

According to copilot, adding this is one way of solving that issue. If you have a preference for another way just let me know.

from mpt_api_client.models import ResourceData


class ValidateMixin[BaseModel]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question... Do you really need all of the these action-based mixins here? I mean, it make sense when you are trying to share some functionality, like update/create/etc. But for specific actions for orders - what's the reason to have it as mixin per cada action?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orders and Requests have the same actions.

Orders: "get", "create", "update", "delete", "validate", "process", "query", "complete", "fail" and "template"
Requests: "get", "create", "update", "delete", "validate", "process", "query", "complete" and "template" (missing fail)

@albertsola albertsola force-pushed the MPT-12842/Commerce-Requestes branch from 7ae875d to f6eead4 Compare September 8, 2025 15:05
@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 8, 2025

@albertsola albertsola requested a review from d3rky September 8, 2025 15:07
@albertsola albertsola closed this Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants