ese-msc / introduction-to-python

"Introduction to Python" course for future Imperial College London MSc students
BSD 3-Clause "New" or "Revised" License
75 stars 94 forks source link

Exercise 2.7 - Failing a test from pybryt but successful with the assert #58

Closed edsml-acd23 closed 1 year ago

edsml-acd23 commented 1 year ago

Hi!

As seen in the screenshot, I was able to make a function that finds primes up to n (and pybryt agrees: "- SUCCESS: Your function returns the right primes."), but I can't get it to give me success on: "- ERROR: Hmm... It looks like you are not finding primes correctly."

How should I proceed? Is it something I should be spending time on? Thanks :)

Screenshot 2023-08-28 at 11 16 12
edsml-acd23 commented 1 year ago

The assert also yields no errors!

marijanbeg commented 1 year ago

Hi @edsml-77e2dd98, thank you for raising this issue. This is fine, and here is the explanation from README:

Although PyBryt provides much more detailed feedback, it is possible it complains about your code even though assert statement confirms your code is correct. This is because PyBryt testing is based on comparing your solution to reference solutions. Since there is virtually an infinite number of alternative solutions, it is possible that your solution is not in our references. On the other hand, assert statements check the final result of your code and if they do not raise an error, your code is correct and you do not have to address PyBryt's error messages (if any).