pynguin: TypeError: unsupported operand type(s) for |: 'NoneType' and 'NoneType'

Describe the bug Error when generating tests: TypeError: unsupported operand type(s) for |: 'NoneType' and 'NoneType'

To Reproduce Steps to reproduce the behaviour:

  1. Use Pynguin version ‘0.34.0’
  2. Use the following (minimal) code as a subject for test generation:
import os
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt


class FilterCorrelatedFeatures:

    def __init__(self, corr_threshold=0.80):
        self.corr_threshold = corr_threshold
        self.correlated_features = []
        self.corr_matrix = pd.DataFrame()
  1. Use the following command line arguments to Pynguin: python -m pynguin --output-path . -v --project-path src/data_preprocessing/ --module-name hello

  2. Give the error (stack trace, etc) you are encountering: ‘…’ pynguin-log.txt

Expected behavior generate a simple test.

Screenshots NA

Software Version (please complete the following information):

  • OS: [Ubuntu 20.04.6 LTS]
  • Python version [3.10.13]
  • Pynguin Version [0.34.0]

About this issue

  • Original URL
  • State: open
  • Created 7 months ago
  • Comments: 19 (7 by maintainers)

Commits related to this issue

Most upvoted comments

OK, I can reproduce the issue on Linux, when using the Python, numpy, and pandas versions you’ve mentioned. I’ll keep you updated.

I was able to reproduce and fix this particular issue in d811cacc59f73c84e9cd83ceb466ec308c66410b. However, there is yet another issue (at least on my machine) that causes failure: some numpy module cannot be found for whatever reason I do not really understand.

Code that uses numpy or pandas still causes struggles to Pynguin for various reasons, unfortunately.