0

I have some class A that is part of a Python extension I wrote in Rust using PyO3. class A is imported and used as is, as well as being as being subclassed in my Python code as part of a larger Python package. It's not meant to be an independent Rust library.

I want to make tests for class A but I'm not sure if tests should be written in Rust, in Python or both.

What's the recommended way for testing Python extensions written in another language like Rust?

kentwait
  • 1,969
  • 2
  • 21
  • 42
  • Without more details it is hard to decide. Ask yourself this: in which programming language is your code going to be used in? Are you going to be writing Rust code used by other bits inside your program/library that's also written in Rust? If the answer is both Python and Rust, chances are it would be beneficial to write tests for both languages. – metatoaster Feb 13 '19 at 03:49
  • @metatoaster It's for a python package im writing. It's not meant to be a Rust library. – kentwait Feb 13 '19 at 03:53
  • 1
    Just stick with the standard python `unittest` module, and see if that address your needs. Again without more specific details there will be no concrete answers, and it's up to you to figure out whether this approach works/fit for the purposes of your project. – metatoaster Feb 13 '19 at 03:54

0 Answers0