Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make index_len argument to idata optional #98

Merged
merged 1 commit into from
Oct 4, 2021

Conversation

jakelishman
Copy link
Contributor

@jakelishman jakelishman commented Sep 27, 2021

PR #92 added an extra argument to the idata decorator. The new
index_len argument had no default value, and so the calling convention
was incompatible with older releases of ddt. This commit makes the
second argument optional, with the previous default value inferred if it
is not supplied. The single-argument form of idata will now work
again, while the newer method allowing it to be overridden is still
supported.

Fix #97.

PR datadriventests#92 added an extra argument to the `idata` decorator.  The new
`index_len` argument had no default value, and so the calling convention
was incompatible with older releases of `ddt`.  This commit makes the
second argument optional, with the previous default value inferred if it
is not supplied.  The single-argument form of `idata` will now work
again, while the newer method allowing it to be overridden is still
supported.
@jakelishman
Copy link
Contributor Author

@txels, @wswld: apologies for the pings. Please could somebody have a look at this? It's currently not possible to use idata in a portable way between releases, and consequently we (and judging by issue #97, a couple of others too) are having to exclude ddt==1.4.3 in CI to prevent it from breaking things.

Copy link
Contributor

@wswld wswld left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for the contribution

@@ -90,20 +90,30 @@ def data(*values):
Should be added to methods of instances of ``unittest.TestCase``.

"""
return idata(values, len(str(len(values))))
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure how I missed this one before, thanks for taking care of this :)

@wswld wswld merged commit 0324372 into datadriventests:master Oct 4, 2021
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.

Signature change of ddt.idata in 1.4.3 breaks downstream uses
2 participants