Build a Media Catalogue - Step 7

Tell us what’s happening:

This seems straight forward to me and the test output is showing exactly the desired text. What is my error?

Your code so far

class Movie:

# User Editable Region

    def __init__(self, title, year, director, duration):
        if not title.strip():
            raise ValueError('Title cannot be empty')
        if year < 1895:
            raise ValueError('Year must be 1895 or later')
        if not director.strip():
            raise ValueError('Director cannot be empty')
        if duration < 0:
            raise ValueError('Duration must be positive')

        self.title = title
        self.year = year
        self.director = director
        self.duration = duration

# User Editable Region

    def __str__(self):
        return f'{self.title} ({self.year}) - {self.duration} min, {self.director}'

movie1 = Movie('The Matrix', 1999, 'The Wachowskis', -136)
print(movie1)

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:146.0) Gecko/20100101 Firefox/146.0

Challenge Information:

Build a Media Catalogue - Step 7

verify if duration is not greater than 0

What if duration is 0? This instruction is worded a little strangely

        if duration <= 0:
            raise ValueError('Duration must be positive')

It also does not pass. I also skipped to the next step of the workshop and copied the whole code but it doesn’t pass either.

This does pass the test for me.

Try to reset the step and try it again. Maybe something else changed accidentally